<template>
  <div class="header" @click = 'theme'>
    <div class="left">
      <slot name="left"></slot>
    </div>
    <div class="center">
      <slot name="center"></slot>
    </div>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>
<script>
export default {
  name: 'Header',
  data () {
    return {
      themes: ['theme', 'theme1', 'theme2'],
      index: 0
    }
  },
  methods: {
    theme () {
      this.index++
      if (this.index === 3) {
        this.index = 0
      }
      document.documentElement.setAttribute('data-theme', this.themes[this.index])
    }
  }
}
</script>

<style scoped lang='scss'>
  @import './../assets/css/mixin.scss';
  .header {
    width: 100%;
    @include bg_color();
    height: 100px;
    display: flex;
    justify-content: space-between;
    .left, .right {
      width: 84px;
      height: 84px;
      margin-top: 8px;
      *{
        width: 100%;
        height: 100%;
      }
    }
  }
</style>
